how to validate javascript forms for beginners